<HTML>
<Head>
<Title>New Listener</Title>
</Head>
<Body>
<script type="text/javascript" language="JavaScript1.4"><!--

/* This variable holds the listener properties */
var listenerName;
var listenerType;
var listenerPort;

/* Function calls modalDialog */
function CreateListener(type) {
	/* Validate Variables */
	listenerType = document.entry.type.value;
	listenerPort = document.entry.port.value;
	listenerName = document.entry.name.value;

	/* Validate that port is actually an integer */
	if (isNaN( document.entry.port.value)) {
		/* Send message about bad port format */
		alert("Port must be an integer between 0 and 65255.");
	}
	else {
		/* Make sure port is positive and within bounds */
		var n = parseInt(listenerPort);
		if (n < 0 || n > 65255) 
			/* Send an alert about valid port values */
			alert("Port must be an integer between 0 and 65255.");
		else
			/* Send message about bad port format */
			console.sendMessage("CreateListener");
	}
}

function CloseDialog() {
	/* Send message of CloseDialog */
	console.sendMessage("CloseDialog");
}

//--></script>

<Form name="entry">
Listener Name:
<input type=text name="name" value="Listener"><P>
Listener Port:
<input type=text name="port" value="9877"><P>
Listener Type:
<select name="type">
	<option selected value="UDP">UDP Listener
	<option value="TCP">TCP Listener
</select>
<P>
<input type=button value="Ok" onClick="CreateListener();">
<input type=button value="Cancel" onClick="CloseDialog();">
</Form>

</Body>
</HTML>